package com.haier.nengyuan.myapplication;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

public class EnergyChargeDetailActivity extends BaseActivity implements OnClickListener {
    private ImageView mTitleLeft;
    private TextView mTitleCenter;
    private TextView mTitleRight;
    private ImageView energyTotalImage;
    public static final String[] dianFeiArrys = {"1096.23", "1593.23", "1816.23"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_energy_charge_detail);
        initViews();
        initDatas();
    }

    private void initDatas() {
        String changeM = MyDateUtil.changeM(System.currentTimeMillis());
//        changeM = "10";
        if ("09".equals(changeM)) {
            energyTotalImage.setBackgroundResource(R.drawable.energy_total2);
        } else if ("10".equals(changeM) | "11".equals(changeM)) {
            energyTotalImage.setBackgroundResource(R.drawable.energy_total10);

        } else if ("12".equals(changeM)) {
            energyTotalImage.setBackgroundResource(R.drawable.energy_total12);
        }
        mTitleCenter.setText("家电耗电量");
        mTitleRight.setText("");
    }

    private void initViews() {
        energyTotalImage = (ImageView) findViewById(R.id.energy_total);
        mTitleLeft = (ImageView) findViewById(R.id.title_left);
        mTitleCenter = (TextView) findViewById(R.id.title_center);
        mTitleRight = (TextView) findViewById(R.id.title_right);

        mTitleLeft.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        if (id == R.id.title_left) {
            finish();
        }
    }
}
